library(fGarch)
GARCHPredict <- function (timeSeries) {
  sim <- garchFit(~garch(1,1), data=timeSeries, trace=F)
  gc()
  return(predict(sim,n.ahead=1)$meanForecast)
}

sim <- garchFit(~garch(1,1), data=google, trace=F)
?garchFit
predict(sim,n.ahead=1)$meanForecast

ret <-ownPredict(google,GARCHPredict,200,function(x) return(x), simDeTrans)
plot(ret$x2)
lines(ret$y2)
ret$aafe
